package com.kafka.kafka.utils;

import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.common.serialization.StringSerializer;

import java.util.Properties;

/**
 * Project: tobe-better-coder
 * Package: com.kafka.kafka.utils
 *
 * @author : Mr.xu
 * @date : 2023/9/10 15:22
 */
public class PropertiesUtils {

    public static Properties getKafkaProperties(String kafkaServer){
        Properties properties = new Properties();
        properties.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,kafkaServer);

        properties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());
        properties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());

        return properties;
    }
}